{include file='header.html'}
<table>
    <tr> 
        <th>Имя</th>
        <th>Описание</th>
        <th>Менеджер</th>
        <th>Дата добавления</th>
        <th>Дата окончания</th>  
        <th>В архиве</th>  
        <th>Операции</th>
    </tr>
{foreach from=$tenders item=d}
<tr>
    <td> <a href="/tender/{$d->getId()}" > {$d->name}</a></td>
    <td> {$d->about}</td>
    <td> {$d->manager}</td>
    <td> {$d->start_date}</td>
    <td> {$d->end_date}</td>
    <td> {if $d->archive == '0'}НЕТ{else}ДА{/if}</td>
    <td><a href="{geturl route='edittender' id=$d->getId()}">Редактировать</a>
     | {if $d->archive == '0'}<a href="{geturl route='archivetender' id=$d->getId()}">В архив</a>{else}<a href="{geturl route='archivetender' id=$d->getId()}">Из архива</a>{/if} 
    | <a href="{geturl route='deletetender' id=$d->getId()}">Удалить</a></td>
</tr>
{/foreach}
</table>
<h2>Фильтр</h2>
<select name='cats_filter' id='cats_filter'>
<option value="0" ></option>
{foreach from=$cats item=cat}
{if $cat->getId() == $cats_filter}
<option value="{$cat->getId()}" selected='selected'>{$cat->name}</option>
{else}
<option value="{$cat->getId()}">{$cat->name}</option>
{/if}
{/foreach}
</select>

<select name='projects_filter' id='projects_filter'>
<option value="0" ></option>
{foreach from=$projects item=project}
{if $project->getId() == $projects_filter}
<option value="{$project->getId()}" selected='selected'>{$project->name}</option>
{else}
<option value="{$project->getId()}">{$project->name}</option>
{/if}
{/foreach}
</select>
{include file='footer.html'}